// 应用状态管理
import { defineStore } from 'pinia'

interface AppState {
  collapsed: boolean // 侧边栏是否折叠
  loading: boolean // 全局加载状态
}

export const useAppStore = defineStore('app', {
  state: (): AppState => ({
    collapsed: false,
    loading: false,
  }),
  
  actions: {
    toggleCollapsed() {
      this.collapsed = !this.collapsed
    },
    
    setLoading(loading: boolean) {
      this.loading = loading
    },
  },
})

